package com.nuanshui.heatedloan.fund.enums;

import com.google.common.collect.Maps;

import java.util.HashMap;


public enum PaymentBizType{
	
	NONE("00"),
	RECHARGE("100"),//充值;
	WITHDRAW_CASH("101"),//金额提现

	APPOINTMENT_ORDER_PAY("200"),//订单支付

	APPOINTMENT_REFUND("1000"),

	;

	
	private  PaymentBizType(String code){
		this.code = code;
	}
	
	public  final static HashMap<String,PaymentBizType> cache = Maps.newHashMap();
	private String code;//充值的code	

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	public static   PaymentBizType getPayBizType(String code) {
		  
			if(cache.isEmpty()) {
				synchronized (PaymentBizType.class) {
					if(cache.isEmpty()) {
						PaymentBizType[] types =  PaymentBizType.values();
						for(PaymentBizType type :types) {
							cache.put(type.getCode(), type);
						}
					}
				}
			}
			return cache.get(code);
	}
	
	
	
}
